/*
 * @Author: zsc
 * @Date: 2022-06-14 21:38:31
 * @LastEditors: zsc
 * @LastEditTime: 2022-07-26 21:21:58
 * @Description: 楼宇管理
 */
import request from '@/utils/request'
/**
 * 楼宇管理列表接口
 * @param data
 * @returns {*}
 */
export function buildingGetList(data) {
  return request({
    url: '/api/adminBuilding/index',
    method: 'post',
    data
  })
}
/**
 * 楼宇管理详情
 * @param {*} id
 * @returns
 */
export function buildingGet(id) {
  const data = { id: id }
  return request({
    url: '/api/adminBuilding/view',
    method: 'post',
    data
  })
}
/**
 * 楼宇新增
 * @param {*} data
 * @returns
 */
export function buildingCreate(data) {
  return request({
    url: '/api/adminBuilding/create',
    method: 'post',
    data
  })
}
/**
 * 楼宇新增(批量)
 * @param {*} data
 * @returns
 */
export function buildingBulkCreate(data) {
  return request({
    url: '/api/adminBuilding/bulkCreate',
    method: 'post',
    data
  })
}
/**
 * 楼宇修改
 * @param {*} data
 * @returns
 */
export function buildingUpdate(data) {
  return request({
    url: '/api/adminBuilding/update',
    method: 'post',
    data
  })
}
/**
 * 楼宇删除
 * @param {*} id
 * @returns
 */
export function buildingDel(id) {
  const data = { id: id }
  return request({
    url: '/api/adminBuilding/delete',
    method: 'post',
    data
  })
}
/**
 * 楼宇选择
 * @param {*} data
 * @returns
 */
export function buildingColumn(data) {
  return request({
    url: '/api/adminBuilding/column',
    method: 'post',
    data
  })
}
/**
 * 闸道门列表
 * @param {*} buildingId
 * @returns
 */
export function lockIndex(buildingId) {
  return request({
    url: '/api/adminBuilding/lockIndex',
    method: 'post',
    data: {
      building_id: buildingId
    }
  })
}
/**
 * 闸道门删除
 * @param {*} id
 * @returns
 */
export function lockDelete(id) {
  return request({
    url: '/api/adminBuilding/lockDelete',
    method: 'post',
    data: {
      id
    }
  })
}
/**
 * 闸道门添加
 * @param {*} data
 * @returns
 */
export function lockCreate(data) {
  return request({
    url: '/api/adminBuilding/lockCreate',
    method: 'post',
    data: {
      'building_id': data.building_id,
      'lock_door_type': data.lock_door_type,
      'code': data.code,
      'note': data.note
    }
  })
}
/**
 * 闸道门编辑
 * @param {*} data
 * @returns
 */
export function lockUpdate(data) {
  return request({
    url: '/api/adminBuilding/lockUpdate',
    method: 'post',
    data: {
      'id': data.id,
      'building_id': data.building_id,
      'lock_door_type': data.lock_door_type,
      'code': data.code,
      'note': data.note
    }
  })
}

